<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-5 col-sm-2">{:__('Clothbank_id')}:</label>
        <div class="col-xs-5 col-sm-3">
            <input id="c-clothbank_id" data-rule="required" data-source="clothbank/index" class="form-control selectpage" name="row[clothbank_id]" type="text" value="{$row.clothbank_id}">
        </div>
        <label class="control-label col-xs-5 col-sm-2">{:__('是否结算')}:</label>
        <div class="col-xs-5 col-sm-3">
            <input  id="c-is_settle" name="row[is_settle]" type="hidden" value="{$row.is_settle}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-is_settle" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success fa-2x {eq name="$row.is_settle" value="0"}fa-flip-horizontal text-gray{/eq}"></i>
            </a>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    
    <div class="form-group row">
       <label class="control-label col-xs-12 col-sm-2">{:__('采购明细')}:</label>
       <div class="col-xs-12 col-sm-8">
           <dl class="fieldlist" data-template="billtpl" data-name="row[bill]">
               <dd>
                   <ins>{:__('颜色')}</ins>
                   <ins>{:__('数量')}</ins>
                   <ins>{:__('金额')}</ins>
                   <ins>{:__('备注')}</ins>
                   <ins>{:__('操作')}</ins>
               </dd>
               <dd class="form-inline">
                <ins style="color: red; font-weight: bold; text-align: center;">合计：</ins>
                <ins><input name="row[total_nums]" class="form-control" value="{$row.total_nums}" readonly style="color:red; font-weight: bold; border:none;"></ins>
                <ins><input name="row[total_price]" class="form-control" value="{$row.total_price}" readonly style="color:red; font-weight: bold; border:none;"></ins>
			   </dd>
               <hr>
               <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
               <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
               <textarea name="row[bill]" class="form-control" cols="30" rows="5" style="display: none;">{$jsonDetail}</textarea>
           </dl>
           <script id="billtpl" type="text/html">
              <dd class="form-inline">
                <ins><input name="<%=name%>[<%=index%>][color]" class="form-control" type="text" data-rule="required" value="<%=row.color%>"></ins>
                <ins><input name="<%=name%>[<%=index%>][nums]" class="form-control nums" type="number" data-rule="required" value="<%=row.nums%>" id="nums_<%=index%>"></ins>
                <ins><input name="<%=name%>[<%=index%>][price]" class="form-control price" type="number" data-rule="required" value="<%=row.price%>" id="price_<%=index%>"></ins>
				<ins><input name="<%=name%>[<%=index%>][remark]" class="form-control" type="text" value="<%=row.remark%>"></ins>
                <input type="hidden" name="<%=name%>[<%=index%>][id]" value="<%=row.id%>"/>
				<!--下面的两个按钮务必保留-->
                <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
              </dd>
           </script>
       </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" rows="4" name="row[remark]" cols="50">{$row.remark|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
